import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
axios.defaults.baseURL="http://127.0.0.1:8888/api/private/v1"
// 请求拦截器==发送请求获取一些数据需要携带token
// 登录的时候Authorization是null,登录之后返回token就有了
axios.interceptors.request.use(config => {
config.headers.Authorization =window.sessionStorage.getItem('token')
console.log(config);
return config;
},error => {
// Do something with request error
return Promise.reject(error);
});

Vue.prototype.$http=axios;
// 导入全局的样式
import './assets/css/global.css'
// 引入字体图标库iconfont
import './assets/fonts/iconfont.css'

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
